function a(i) {
    wx.request({
        url: e.globalData.host + "/lotto/v1/user_infos",
        data: {
            lid: i.data.lid,
            access_token: t.getToken(),
            page: i.data.page,
            count: i.data.count
        },
        method: "GET",
        dataType: "json",
        success: function(e) {
            if (t.hideLoading(), -500 != e.data.sta) if (0 == e.data.sta) {
                for (var s = e.data.data, d = s.users, l = d.length, n = [], o = 0; o < l; o++) n.push([ {
                    field_value: d[o].nickname,
                    field_name: "用户昵称"
                }, {
                    field_value: d[o].username,
                    field_name: "用户姓名"
                }, {
                    field_value: d[o].prize,
                    field_name: "\b奖品"
                }, {
                    field_value: d[o].phone,
                    field_name: "手机"
                }, {
                    field_value: d[o].address,
                    field_name: "地址"
                }, {
                    field_value: d[o].message,
                    field_name: "留言"
                } ]);
                i.setData({
                    tableData: n,
                    width: "1360rpx",
                    noMoreUser: s.users.length < i.data.count
                });
            } else t.showFailedToast("数据加载失败", e.data.msg); else t.login(function() {
                a(i), i.setData({
                    hasUserInfo: !0
                });
            }, function() {
                i.setData({
                    hasUserInfo: !1
                });
            });
        },
        fail: function(a) {
            t.hideLoading();
        }
    });
}

var t = require("../../utils/util.js"), e = getApp();

Page({
    data: {
        page: 1,
        count: 100,
        field_list: [ "用户昵称", "用户姓名", "奖品", "手机", "地址", "留言" ],
        tableData: []
    },
    onLoad: function(a) {
        var t = a.lid;
        this.setData({
            lid: t || ""
        });
    },
    onShow: function() {
        a(this);
    },
    otherUser: function(t) {
        "prev" == t.currentTarget.dataset.type ? this.setData({
            page: this.data.page - 1
        }) : this.setData({
            page: this.data.page + 1
        }), a(this);
    },
    showAll: function(a) {
        var t = a.currentTarget.dataset.index, e = a.currentTarget.dataset.idx, i = this.data.tableData[t], s = [], d = 110, l = this.data.showAll;
        if (l) {
            for (var n = i.length, o = 0; o < n; o++) s.push(250);
            this.setData({
                tdWidth: s,
                width: 250 * n + 110 + "rpx",
                showAll: !1
            });
        } else {
            for (o = 0; o < i.length; o++) {
                var r = i[o], h = 250;
                o == e && (h = (h = 30 * r.field_value.length) > 250 ? h : 250), s.push(h), d += h;
            }
            this.setData({
                tdWidth: s,
                width: d + "rpx",
                showAll: !0
            });
        }
    },
    export: function() {
        t.buttonClicked(this), wx.navigateTo({
            url: "/pages/export/export?lid=" + this.data.lid
        });
    }
});